<?php

/**
 * Tabela de Documentos.
 *
 * @author Fernando Dias Oliveira <rodox17@gmail.com>
 * @package intranet
 * @subpackage model
 */

class INT012 extends Zend_Db_Table_Abstract  
{
	protected $_table   = "INT012";
	protected $_primary = "INT012_cod";

	private $INT012_cod;
	private $INT012_nome;
	
	/**
	 * Metodo que retorna um array bidimensional para drop down.
	 * 
	 * @access public
	 * @return array
	 */
	
	public function getBid()
	{
		$arr[""] = "";
		
		foreach ($this->fetchAll()->toArray() as $val)
		{
			$arr[$val["INT012_cod"]] = $val["INT012_nome"];
		}
		
		return $arr;
	}
	
	/**
	 * Metodo que retorna um array bidimensional com os registros
	 * de acordo com o id.
	 * 
	 * @param int $id
	 * @access public
	 * @return array
	 */
	
	public function getById($id)
	{
		$arr = $this->fetchAll("INT012_cod = $id")->toArray();
		
		return $arr[0];
	}
}

?>
